package dao;


import model.Race;
import model.User;

import java.util.List;

/**
 * The interface Race dao.
 */
public interface RaceDao {
    /**
     * Update int.
     *
     * @param race the race
     * @return the int
     */
    int update(Race race);

    Race getRaceById(int rid);

    /**
     * Insert int.
     *
     * @param race the race
     * @return the int
     */
    int insert(Race race);

    /**
     * Delete int.
     *
     * @param rid the rid
     * @return the int
     */
    int delete(int rid);

    /**
     * Gets all races.
     *
     * @param pageSize  the page size
     * @param pageIndex the page index
     * @return the all races
     */
    List<Race> getAllRaces(int pageSize,int pageIndex);

    /**
     * Gets races by user.
     *
     * @param uid       the uid
     * @param pageSize  the page size
     * @param pageIndex the page index
     * @return the races by user
     */
    List<Race> getRacesByUser(int uid, int pageSize,int pageIndex);

    List<Race> findByPartName(String partName, int pageIndex, int pageSize);

    int pageCount();

    int countByUser(int uid);

    int countByName(String partName);
}
